home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00a.txt
/
000062_icon-group-sender _Wed Apr 12 10:26:43 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA07719
for icon-group-addresses; Wed, 12 Apr 2000 10:26:25 -0700 (MST)
Message-Id: <200004121726.KAA07719@baskerville.CS.Arizona.EDU>
Date: Wed, 12 Apr 2000 09:40:48 -0700
From: Steve Wampler <swampler@noao.edu>
X-Accept-Language: en
To: Taybin Rutkin <trutkin@black.clarku.edu>,
icon-group <icon-group@optima.CS.Arizona.EDU>
Subject: Re: Idol function pointers
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Taybin Rutkin wrote:
>
> I hope this is the right forum to discuss Idol...
>
> How would I pass a method as a variable? I'm trying to create an event
> system. The call I'm using is
>
> edges$watch(vertices$E_Update)
>
> watch is the function that links the method to a list of procedures. I'm
> trying to call a method in a specific object. vertices is the instance
> and E_Update is the method that should be called at a later date. The
> code works fine if I use a regular procedure. I poked through the Icon
> output but the code it generated for that line was:
>
> edges.__m.watch(edges,vertices.__m.E_Update(vertices))
>
> I mostly understand that line, so I guess I need a way to remove the
> vertices arguement at the end.
>
> Any hints?
Taybin - in many OO languages, including Idol (and Java...), you cannot
disassociate a method from its class in the way you'd like. Pass the
class down and invoke the method within the procedure. Note that this
imposes some discipline on how you write the code. In Java, you'd use
an interface to enforce the discipline; in Idol, you'll have to rely
on self-discipline.
--
Steve Wampler- SOLIS Project, National Solar Observatory
swampler@noao.edu